import request from '@/utils/request2'

// 查询寝室列表
export function listDor(dor) {
  return request({
    url: '/stuManage/dor/tree/list',
    method: 'get',
    params:dor
  })
}

export function findChildrenDorCasById(parentId) {
  return request({
    url: `/stuManage/dor/findChildrenCasById`,
    method: 'get',
    params: parentId
  })
}

export function findChildrenDorCasByIds(parentIds) {
  return request({
    url: `/stuManage/dor/findChildrenCasByIds/${parentIds}`,
    method: 'get'
  })
}

export function findChildrenByParentId(parentId) {
  return request({
    url: `/stuManage/dor/findChildrenByParentId`,
    method: 'get',
    params: parentId
  })
}

export function findAreaBuilding() {
  return request({
    url: `/stuManage/dor/findAreaBuilding`,
    method: 'get'
  })
}

export function findAreaBuildingFloor() {
  return request({
    url: `/stuManage/dor/findAreaBuildingFloor`,
    method: 'get'
  })
}

export function findAreaBuildingFloorRoom() {
  return request({
    url: `/stuManage/dor/findAreaBuildingFloorRoom`,
    method: 'get'
  })
}

//findFloorRoomByParentIds
export function findFloorRoom(parentId) {
  return request({
    url: `/stuManage/dor/findFloorRoom`,
    method: 'get',
    params:parentId
  })
}

//findFloorRoomByParentIds
export function findFloorRoomByParentIds(parentIds) {
  return request({
    url: `/stuManage/dor/findFloorRoomByParentIds/${parentIds}`,
    method: 'get'
  })
}

// 查询寝室详细
export function getDor(id) {
  return request({
    url: '/stuManage/dor/' + id,
    method: 'get'
  })
}

// 新增寝室
export function addDor(data) {
  return request({
    url: '/stuManage/dor',
    method: 'post',
    data: data
  })
}

// 修改寝室
export function updateDor(data) {
  return request({
    url: '/stuManage/dor',
    method: 'put',
    data: data
  })
}

// 删除寝室
export function delDor(id) {
  return request({
    url: '/stuManage/dor/' + id,
    method: 'delete'
  })
}

// findChildrenNoCas
export function findChildrenNoCas(parentId) {
  return request({
    url: `/stuManage/dor/findChildrenNoCas/${parentId}`,
    method: 'get'
  })
}
